#!/bin/bash

# pnm2c44.sh 
# Combines all colour pnm files in the current directory into a bundled .djvu document
# 
# (c) nabster
# Distribute under GPL
#
# Usage: ./pnm2c44.sh output_file_name_without_extension
#
for file in $( ls *.pnm); do
filename=${file%.pnm}
echo c44 $file $filename.djvutemp
c44 $file $filename.djvutemp
done
echo combining
djvm -c $1.djvu `ls $1*.djvutemp`
echo displaying
djview $1.djvu
echo removing $1*.djvutemp
echo done
rm $1*.djvutemp
